<template>
  <div class="container">
    <nav class="bottom-bar">
      <router-link
        to="/"
        class="tab-item"
        :class="{ active: currentKey == 'index' }"
      >
        <span class="music-icon"></span>
        <span class="mui-tab-label">首页</span>
      </router-link>
      <router-link
        to="/radio"
        :class="{ 'tab-item': true, active: currentKey == 'radio' }"
      >
        <span class="radio-icon"></span>
        <span class="mui-tab-label">电台</span>
      </router-link>
      <router-link
        to="/heartbeat"
        :class="{ 'tab-item': true, active: currentKey == 'heartbeat' }"
      >
        <span class="heartbeat-icon"></span>
        <span class="mui-tab-label">扑通</span>
      </router-link>
      <router-link
        to="/my"
        :class="{ 'tab-item': true, active: currentKey == 'my' }"
      >
        <span class="my-icon"></span>
        <span class="mui-tab-label">我的</span>
      </router-link>
    </nav>
  </div>
</template>
<script>
export default {
  name: "tabbar",
  props: {
    currentKey: {
      type: String,
      default: "index",
    },
  },
};
</script>
<style scoped>
.container{
  position: fixed;
  z-index: 99;
  right: 0;
  left: 0;
  bottom: 0;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #929292;
  font-size: 17px;
}
.tab-item.active {
  color: #ff7d15;
  /* filter: drop-shadow(0px 0px #ff7d15); */
}
.bottom-bar {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #ccc;
}
.music-icon {
  width: 24px;
  height: 24px;
  background-image: url("./icons/music.png");
  background-size: cover;
  background-repeat: no-repeat;
}
.radio-icon {
  width: 24px;
  height: 24px;
  background-image: url("./icons/radio.png");
  background-size: cover;
  background-repeat: no-repeat;
}
.my-icon {
  width: 24px;
  height: 24px;
  background-image: url("./icons/my.png");
  background-size: cover;
  background-repeat: no-repeat;
}
.heartbeat-icon {
  width: 24px;
  height: 24px;
  background-image: url("./icons/heartbeat.png");
  background-size: cover;
  background-repeat: no-repeat;
}
</style>